/*
 * @Author: liuzibin
 * @Date: 2023-07-24 01:04:32
 * @Descroption: 登录用户
 */
const axios = require("axios");

async function loginUser({ account, password }) {
  const response = await axios.post(
    "https://borderclear.cn//api/auth/login",
    {
      account,
      password,
      auth_token: "",
    },
    {
      headers: {
        Accept: "application/json, text/plain, */*",
        Referer: "http://borderclear.cn/admin/merchant/list",
        "User-Agent":
          "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "Content-Type": "application/json;charset=UTF-8",
      },
    }
  );

  return response.data.data.token;
}

module.exports = loginUser;
